﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="productAutoAddList.aspx.cs"
    Inherits="PeisongWeb.admin.productAutoAddList" %>

<%@ Register TagName="top" Src="controls/top.ascx" TagPrefix="uc1" %>
<%@ Register TagName="menu" Src="controls/menu.ascx" TagPrefix="uc2" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>系统加价管理 - 想购网长期采购物流配送系统</title>
    <!--#include file="style.inc"-->
    <script src="/app_common/scripts/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script type="text/javascript">
        function checkPrice(obj) {
            var t = $(obj).parent().prev().prev().find('input')[0];
            var t1 = $(obj).parent().prev().prev().find('input')[1];
            $('#hdCurrentOldAutoAdd').val($(t1).val());
            var pattern = /^[0-9]+([.]\d{1,2})?$/;
            if (!pattern.test($(t).val())) {
                alert('请输入正确的自动加价比例!');
                $(t).focus();
                return false;
            } else {
            if (parseFloat($(t).val()) > 0) {
                $('#hdCurrentNewAutoAdd').val($(t).val());
                return true;
            }
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ScriptManager ID="ScriptManager1" runat="server" />
    <uc1:top ID="Top1" runat="server" />
    <uc2:menu ID="Menu1" runat="server" />
    <div id="admin-body">
        <h2 class="section-cms">
            系统加价管理
        </h2>
        <ext:Panel ID="Panel1" runat="server" Title="系统加价管理" BodyStyle="padding:5px 5px 0"
            Width="960px" Frame="true" ButtonAlign="Center">
            <Body>
                <div id="admin_edit_content_search">
                    <ul>
                        <li style="width: auto; margin-right: 20px;">
                            <label>
                                大类</label>
                            <asp:DropDownList runat="server" ID="ddl_CategoryRoot" DataTextField="name" DataValueField="categoryId"
                                AutoPostBack="True" OnSelectedIndexChanged="ddl_CategoryRoot_SelectedIndexChanged">
                            </asp:DropDownList>
                        </li>
                        <li style="width: auto; margin-right: 20px;">
                            <label>
                                小类</label>
                            <asp:DropDownList runat="server" ID="ddl_CategorySub" DataTextField="name" DataValueField="categoryId">
                            </asp:DropDownList>
                        </li>
                        <li style="width: auto; margin-right: 20px;">
                            <label>
                                商品名称</label>
                            <asp:TextBox ID="txt_ProductName" runat="server" Width="120px"></asp:TextBox>
                        </li>
                        <li style="width: auto; margin-right: 20px;">
                            <label>
                                商品编号</label>
                            <asp:TextBox ID="txt_ProductNo" runat="server" Width="120px"></asp:TextBox>
                        </li>
                        <li style="width: auto; margin-right: 20px;">
                            <label>
                            </label>
                            [<asp:LinkButton ID="lbtn_Search" runat="server" Text="搜 索" OnClick="lbtn_Search_Click"
                                CausesValidation="false"></asp:LinkButton>] </li>
                    </ul>
                </div>
            </Body>
        </ext:Panel>
        <p>
            &nbsp;</p>
        <div id="admin_list_content">
            <table cellpadding="0" cellspacing="0">
                <tr class="header-row">
                    <th>商品名称</th>
                    <th>供应价</th>
                    <th>自动加价比例</th>
                    <th></th>
                    <th>加价后的价格</th>
                    <th>操作</th>
                </tr>
                <asp:Repeater ID="rpt_list" runat="server" onitemcommand="rpt_list_ItemCommand">
                    <ItemTemplate>
                        <tr class='<%# Container.ItemIndex%2==0? "row-alt":"alt"  %>'>
                            <td>
                                <%#DataBinder.Eval(Container.DataItem,"className") %><%#Eval("name")%>
                            </td>
                            <td><%#Eval("sellerPrice","{0:F2}")%></td>
                            <td><%#Eval("autoAdd")%></td>
                            <td>
                                <input type="text" style="width:75px;" value='<%#Eval("autoAdd")%>' /><input type="hidden" value='<%#Eval("autoAdd")%>' />
                            &nbsp;</td>
                            <td>
                                <%#Eval("price","{0:F2}")%>
                            </td>
                            <td>
                                <asp:LinkButton runat="server" ID="link_Edit" OnClientClick="return checkPrice(this);" CommandName="Edit" CommandArgument='<%#Eval("productId") %>'>保存</asp:LinkButton>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <div id="page">
                <webdiyer:AspNetPager ID="AspNetPager1" NumericButtonType="Text" MoreButtonType="Text"
                    OnPageChanged="AspNetPager1_PageChanged" runat="server" AlwaysShow="True" PageSize="20"
                    InvalidPageIndexErrorMessage="无效页码" PageIndexOutOfRangeErrorMessage="页码超出范围"
                    ShowCustomInfoSection="Left" CustomInfoHTML=" 每页%PageSize%条记录 | 总共%RecordCount%条记录 "
                    CustomInfoTextAlign="Left" HorizontalAlign="Right" NextPageText="下一页" FirstPageText="首页"
                    LastPageText="末页" PrevPageText="上一页">
                </webdiyer:AspNetPager>
            </div>
        </div>
    </div>
    <asp:HiddenField runat="server" ID="hdCurrentNewAutoAdd" />
    <asp:HiddenField runat="server" ID="hdCurrentOldAutoAdd" />
    </form>
</body>
</html>
